/*
 * bootloader.h
 *
 * Created: 27.7.2013 9:56:09
 *  Author: Ferda
 */ 


#ifndef BOOTLOADER_H_
#define BOOTLOADER_H_

#include <avr/io.h>

#define VERSION_NAME_LENGTH	24
#define APP_INFO_ADDRESS (E2END + 1 - sizeof(application_info_t))
#define VALID 0x00
#define INVALID 0xFF

typedef struct 
{
	char version[VERSION_NAME_LENGTH+1];	// firmware file name
	uint16_t code_size;						// code size in words
	uint16_t crc16;							// crc code of loaded firmware
	uint8_t invalid;						// invalid app flag	, 0xFF == invalid, 0x00 == valid
	uint16_t	brd;						// baud rate divider, can easy change bootloader starting speed
} application_info_t;

extern application_info_t app_info;
extern void loadAppInfo();
extern void storeAppInfo();

#endif /* BOOTLOADER_H_ */